import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import {VueMasonryPlugin} from 'vue-masonry'
// import VueLazyload from 'vue-lazyload'
import InfiniteLoading from 'vue-infinite-loading';
import { Lazyload } from 'vant';
Vue.use(Lazyload,{
    preLoad: 1.3,
    error: require('./assets/error.png'),
    loading: require('./assets/加载.png'),
    attempt: 1,
  });
Vue.use(InfiniteLoading, { /* options */ });
// Vue.use(VueLazyload,{
//   preLoad: 1.3,
//   error: require('./assets/error.png'),
//   loading: require('./assets/加载.png'),
//   attempt: 1,
// })
Vue.use(VueMasonryPlugin)
Vue.prototype.$http=axios
Vue.config.productionTip = false
const setHtmlFontSize = () => {
  const htmlDom = document.getElementsByTagName('html')[0];
  let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
  if (htmlWidth >= 375) {
    htmlWidth = 375;
  }
  if (htmlWidth <= 320) {
    htmlWidth = 300;
  }
  htmlDom.style.fontSize = `${htmlWidth/7.5}px`;
  };
window.onresize = setHtmlFontSize;
setHtmlFontSize();
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
